<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改商品分类')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-goodsCat-edit" th:object="${goodsCat}">
            <input id="catId" name="catId" th:field="*{catId}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">父分类id：</label>
				<div class="col-sm-8">
					<input id="parentId" name="parentId" th:field="*{parentId}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">祖级列表：</label>
				<div class="col-sm-8">
					<input id="ancestors" name="ancestors" th:field="*{ancestors}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">分类名称：</label>
				<div class="col-sm-8">
					<input id="catName" name="catName" th:field="*{catName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">显示顺序：</label>
				<div class="col-sm-8">
					<input id="orderNum" name="orderNum" th:field="*{orderNum}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">类型名称：</label>
				<div class="col-sm-8">
					<select id="goodsType" name="typeId" class="form-control" required>
						<option th:each="type:${goodsTypes}" th:value="${type.typeId}" th:text="${type.name}"
								th:selected="${type.typeId eq goodsCat.typeId}"></option>
					</select>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "goods/goodsCat";
		$("#form-goodsCat-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-goodsCat-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
